Render only shadow Pass

Any way to render full shadow pass that doesn’t get masked out by objects? Seems there is always a pixel difference between the clown pass and the edges of the objects when trying to separating the object from the shadow in Photoshop. Object on table, casting shadow below, then use the clown pass to split the layer so you can control the shadow layer seperately, there is a pixel difference in the layers. They don’t match. When using the wand and clown pass to make a mask, or split the layer, there’s an empty pixel around the object-
am i doing this wrong in PS or is there another way of doing this?

I think it’s just a result of anti-aliasing and hard to prevent completely. You can’t pick a certain matte color for transparent images in KS I think so what I normally do is just put a dark/black layer below everything else.

I’m not sure if you render the shadow pass with transparency, maybe it gives a better result without the transparency since it at least will have a color instead of the transparent/semi-transparent pixels.

But as long as you select items using clown passes you will still have the same since Photoshop will select with a ‘feather’ of semi-transparent pixels. You can turn that selection into a quick mask and use the ‘adjust levels’ on the quick mask so you can tweak the outside pixels by making them full black. That way you would get rid of the white line, it just will eat away a bit of the object but if you work with high res renders nobody will notice.

When using the magic wand to do the selections in photoshop have you tried un ticking ant- aliasing or tweaking the tolerance value? Both of these can be found at the top of the screen when the magic wand is the selected tool.

I think you can use old trick, assigning Emissive material to your object and making it visible in shadows, but invisible to camera:

1 Like

i have not turned off antialiasing, but I play with the tolerance levels all the time since KS puts colors touching that are only 10% different lol. I’ll give it a shot.

@oleksii.rybakov I think i did this once a long time ago, and while a pain, it worked. Trying to see if there is a solid workflow fix, as I deal with this all the time. Would be awesome to have a function that would be “render out shadow pass” and have KS do that for me.

This is definitely the way to do it.
Create a model set for your object and apply the material to the whole model set.
Shadows won’t be black, but if you render shadows on a black background then most render engines don’t know what to do with sampling because they usually only include RGB and not alpha. A workaround is to just render on stark white background color. Then in photoshop, just create an action that inverts the layer, then select the value of RGB. Create a new layer and fill with black and voila, you’ve got yourself a shadow that can be used on top of anything.

If you render black shadows on black background so the colors are actually black you’ll need thousands of samples. If you render it black on white, you can probably do something like 16 samples and add denoise.

Having the shadow render like this as a pass without having to set all of that up would be a Great feature to add.

Now, if you didn’t render a shadow separately and you want it to be like this, I suggest using the liquify tool to just nudge the shadow under your product all the way around. You can use smudge also, but that is baked in for every stroke where liquify is basically like painting vector displacement, then doing it all at once to minimize detail loss. Also, if you happen to have multiple lighting options that create different shadows you can save and reuse the same map.

The last option, is just to not remove the product at all! Show the product on white, ctrl+Click on the blue channel. fill with black on a new layer behind your product. Add a mask, then brush away the edges that don’t touch the ground. Instead of the issue of antialised pixel selections creating a halo, you just get slightly darker pixels where the shadow touches the object, which is probably just fine.

1 Like

Sure, also dreamed about ‘only ground shadows’ pass from long ago.

1 Like